﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyTestProject.Validation
{
    public  class RequiredExtend : AttributeBase
    {
        public RequiredExtend(string errorMessage = null)
        {
             ErrorMessage = errorMessage;
        }

        public override bool IsValid(object obj)
        {
            if (obj==null)
            {
                return false;
            }
            if (string.IsNullOrEmpty(obj.ToString()))
            {
                return false;
            }
            return true;
        }
    }
}
